package com.aaa.controller;



import com.aaa.entity.ZcglRentasset;
import com.aaa.service.ZcglRentassetService;

import com.aaa.util.Result;
import com.baomidou.mybatisplus.extension.api.ApiController;

import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * (ZcglRentasset)表控制层
 *
 * @author makejava
 * @since 2021-02-20 10:10:46
 */
@RestController
@RequestMapping("rentasset")
public class ZcglRentassetController extends ApiController {
    /**
     * 服务对象
     */
    @Resource
    private ZcglRentassetService service;

    
    /**
     * create by: Student洋
     * description: 修改
     */
    @RequestMapping("/update")
    public Result update(@RequestBody ZcglRentasset update){
        int a = service.updateRentasset(update);
        if (a != 0 ){

            return new Result(1023,"修改成功",null);
        }
        return new Result(1023,"修改失败",null);
    }

    /**
     * create by: Student洋
     * description: 逻辑删除
     */
    @RequestMapping("/del")
    public Result delete(String assetNumber) {
        boolean del = service.delete(assetNumber);
        if (del){
            return new Result(1005,"删除成功 ",null) ;
        }
        return new Result(1005,"删除失败 ",null) ;
    }


    /**
     * create by: Student洋
     * description: 添加
     */
    @RequestMapping("/add")
    public Result add(@RequestBody ZcglRentasset add){
        int a = service.addRentasset(add);

        if (a != 0 ){
            return new Result(1023,"添加成功",null);
        }
        return new Result(1024,"添加失败",null);
    }







}